package cn.zktr.Personnel.controllers.zhouyongcong.end;


import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.zktr.Personnel.model.service.zhouyongcong.findService;
import cn.zktr.Personnel.model.service.zhouyongcong.end.separationService;

@Controller
public class separationController {
	@Autowired
	private findService fs;
	@Autowired
	private separationService ss;
	
	@RequestMapping("zyc/emp-separation")
	public void emp_separation(Model mod,HttpSession session){
		Integer empid = Integer.valueOf(session.getAttribute("id")+"");
		mod.addAttribute("empdet", fs.findEmpid(empid));
	}
	@RequestMapping("zyc/emp-separ")
	public void emp_separ(Model mod,HttpSession session){
		mod.addAttribute("dis", fs.findAllDis());
	}
	
	@PostMapping("separations")
	public String tail_1s(HttpSession session,Integer empid,String disyy){
		ss.adddis(empid, disyy);
		session.removeAttribute("id");
		return "home-pape";
	}
	
	@RequestMapping("fuzhi")
	@ResponseBody
	public void fuzhi(Integer disid) {
		System.out.println(disid);
		ss.fuzhi(disid);
	}
}
